package models

import "time"

type User struct {
    ID           uint      `gorm:"primaryKey" json:"id"`
    Username     string    `gorm:"size:100;uniqueIndex;not null" json:"username"`
    DisplayName  string    `gorm:"size:100" json:"display_name"`
    Email        string    `gorm:"size:150" json:"email"`
    AvatarURL    string    `gorm:"size:255" json:"avatar_url"`
    Role         string    `gorm:"size:20;not null;default:customer" json:"role"`
    PasswordHash string    `gorm:"size:255;not null" json:"-"`
    CreatedAt    time.Time `json:"created_at"`
    UpdatedAt    time.Time `json:"updated_at"`
}

func (User) TableName() string {
	return "users"
}
